<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./dist/vue.js"></script>
    <!-- 在这里写style -->
    <style>
      .active{
        color:red
      }
      .coactive{
          color:blue
      }
      .bgactive{
          background-color: darkgrey
      }
    </style>
</head>
<body>
    <!-- 
        class有数组写法 和 对象写法
     -->
    <div id="app">
      <div class="active">样式</div>
      <!-- 对象写法 -->
        <div :class="{active:flag}">Vue对象样式</div>
        <!-- <div :class=" flag?'active:'' ">Vue样式</div> -->
      <!-- 数组写法(多个样式) -->
        <div class="coactive bgactive">样式</div> <!-- 注意是空格 -->
        <div :class="[colorclass,bgclass]">vue数组样式</div> <!-- 注意是逗号 ，并且要在data中定义 -->
      
    </div>
</body>
<script>
    const vm = new Vue({
        el:"#app",
        data:{
            flag:true,
            colorclass:'coactive',
            bgclass:'bgactive'
        }
    })
</script>
</html>